package com.dd.consul_consumer_feign.service;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import springfox.documentation.annotations.ApiIgnore;

import com.dd.consul_consumer_feign.config.DisableHsytrixConfiguration;
import com.dd.consul_consumer_feign.dto.UserDto;

@ApiIgnore
@FeignClient(name="consul-provider",  configuration = DisableHsytrixConfiguration.class,fallback = UserServiceFallback.class)
//@FeignClient(name="consul-provider", fallback = UserServiceFallback.class)
//禁用hsytrix
public interface UserService {
	
    @RequestMapping(method = RequestMethod.GET, value = "/")
    String hello();
    
    @RequestMapping(method = RequestMethod.GET, value = "/user/list")
    List<UserDto> list();
    
    @RequestMapping(method = RequestMethod.GET, value = "/user/getUser/{id}")
    UserDto getUser(@PathVariable("id") Long id);
    
    @RequestMapping(method = RequestMethod.POST, value = "/user/add")
    boolean add(UserDto user);
    
    @RequestMapping(method = RequestMethod.POST, value = "/user/update")
    boolean update(UserDto user);
    
    @RequestMapping(method = RequestMethod.POST, value = "/user/delete/{id}")
	public boolean delete(@PathVariable("id") Long id);
    
    @RequestMapping(method = RequestMethod.GET, value = "/user/getUserTimeOut/{id}")
    UserDto getUserTimeOut(@PathVariable("id") Long id);
}
